package Java0310;

import java.util.Scanner;

public class PrintTriangle1 {
    public static void main(String[] args) {
        //没有是实现空心
        Scanner in = new Scanner(System.in);
        System.out.println("请输入高度：");
        int h;
        while (true) {
            h = in.nextInt();
            if (h >= 1) {
                break;
            }
            System.out.println("重新输入！");
        }
        for (int i = 1; i <= h; i++) {
            for (int j = 1; j <= h - i; j++) {
                System.out.print(" ");
            }
            for (int k = 1; k <= 2 * i - 1; k++) {
                System.out.print("I");
            }
            System.out.println();
        }
    }
}


